// CoffeeShopApp.java
import java.util.Scanner;

class CoffeeShopApp {
    // 创建一些咖啡对象作为菜单
    static Coffee[] menu = {
        new Coffee("元宇宙拿铁", 32.0, "虚拟与现实的完美融合", 20),
        new Coffee("哈希焦糖玛奇朵", 36.0, "区块链技术加持，每口都是独一无二的哈希值", 25),
        new Coffee("二进制冰美式", 28.0, "极简主义代表，只有0和1两种成分", 15),
        new Coffee("递归卡布奇诺", 34.0, "无限自我调用的美味", 30),
        new Coffee("8988", 56.0, "55", 10),
        new Coffee("223", 77.0, "5535", 30)
    };
    
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        
        System.out.println("====================================");
        System.out.println("     面向对象版赛博朋克咖啡屋！     ");
        System.out.println("====================================");
        
        // 创建顾客
        System.out.println("欢迎光临！请问你的名字是？");
        String name = scanner.nextLine();
        System.out.println("请输入你的初始余额：");
        double balance = scanner.nextDouble();
        
        Customer customer = new Customer(name, balance);
        System.out.println("你好，" + customer.getName() + "! 当前能量值: " + customer.getEnergyLevel() + "%");
        
        // 显示菜单
        System.out.println("\n============= 咖啡菜单 =============");
        for (int i = 0; i < menu.length; i++) {
            System.out.print((i+1) + ". ");
            menu[i].displayInfo();
        }
        
        // 点单
        System.out.println("\n请输入你想要的咖啡编号 (1-" + menu.length + "): ");
        int choice = scanner.nextInt() - 1;
        
        System.out.println("要来几杯呢？");
        int quantity = scanner.nextInt();
        
        // 创建订单
        Order order = new Order(customer, menu[choice], quantity);
        
        // 处理订单
        System.out.println("\n>>> 处理订单中... <<<");
        order.processOrder(null);
        
        // 显示订单详情
        System.out.println("\n>>> 订单详情 <<<");
        order.displayOrder();
        
        System.out.println("\n谢谢光临！欢迎下次再来！");
        scanner.close();
    }
}